"use strict";
exports.__esModule = true;
exports.copy = void 0;
/**
 * @param copy 深拷贝
 * @param _object 如果不传返回为空对象 必须是js的{}对象
 * @param _obj 可选 返回传入的@param _object 必须是js的{}对象,
 */
var copy = function (_object, _obj) {
    if (_obj === void 0) { _obj = {}; }
    if (!(Object.prototype === Object.getPrototypeOf(_object))) {
        return new Error('传入参数***_object***类型错误');
    }
    for (var key in _object) {
        if (Object.prototype === Object.getPrototypeOf(_object[key])) {
            _obj[key] = (0, exports.copy)(_object[key]);
        }
        else {
            _obj[key] = _object[key];
        }
    }
    return _obj;
};
exports.copy = copy;
var a = { name: '123', title: { name: '123' } };
// const tang = copy(a);
var tang = a;
a.name = 'zhu';
console.log(tang);
